package com.lagouedu.service.impl;


import com.lagouedu.service.DubboMointerService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;


@Service
@Component
public class MoniterServiceImpl implements DubboMointerService {
    @Override
    public String methodA() {
        int sleepTime = 0;
        try {
            sleepTime = (int) (Math.random()*100);
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "MethodA:" + String.valueOf(sleepTime);
    }

    @Override
    public String methodB() {
        int sleepTime = 0;
        try {
            sleepTime = (int) (Math.random()*100);
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "MethodB:" + String.valueOf(sleepTime);
    }

    @Override
    public String methodC() {
        int sleepTime = 0;
        try {
            sleepTime = (int) (Math.random()*100);
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "MethodC:" + String.valueOf(sleepTime);
    }
}
